Skip to contentSkip to conversation

Change in openvpn[master]: sample: Fix cppcheck error invalidPrintfArgType_sint

Openvpn-devel In review flichtenheld (Code Review) 2 participants 6 messages May 5 – May 7 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): gerrit.1778018195000.Ia7ad24181bd97dccbb77865c10e829778f72a506@...2715...

#1 lore raw

Attention is currently required from: plaisthos.

Hello plaisthos,

I'd like you to do a code review.
Please visit

    http://gerrit.openvpn.net/c/openvpn/+/1662?usp=email

to review the following change.

Change subject: sample: Fix cppcheck error invalidPrintfArgType_sint
......................................................................

sample: Fix cppcheck error invalidPrintfArgType_sint

Change-Id Ia7ad24181bd97dccbb77865c10e829778f72a506

---
M sample/sample-plugins/log/log_v3.c
M sample/sample-plugins/simple/base64.c

2 files changed, 2 insertions(+), 2 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/62/1662/1

sample/sample-plugins/log/log_v3.c +1 -1
index fae7bc4..09c6735 100644
@@ -91,7 +91,7 @@
     }
 
     /* Print some version information about the OpenVPN process using this plug-in */
-    printf("log_v3: OpenVPN %s  (Major: %i, Minor: %i, Patch: %s)\n", args->ovpn_version,
+    printf("log_v3: OpenVPN %s  (Major: %u, Minor: %u, Patch: %s)\n", args->ovpn_version,
            args->ovpn_version_major, args->ovpn_version_minor, args->ovpn_version_patch);
 
     /*  Which callbacks to intercept.  */
sample/sample-plugins/simple/base64.c +1 -1
index ab6aed8..3b11543 100644
@@ -122,7 +122,7 @@
     ovpn_base64_decode = args->callbacks->plugin_base64_decode;
 
     /* Print some version information about the OpenVPN process using this plug-in */
-    ovpn_log(PLOG_NOTE, PLUGIN_NAME, "OpenVPN %s  (Major: %i, Minor: %i, Patch: %s)\n",
+    ovpn_log(PLOG_NOTE, PLUGIN_NAME, "OpenVPN %s  (Major: %u, Minor: %u, Patch: %s)\n",
              args->ovpn_version, args->ovpn_version_major, args->ovpn_version_minor,
              args->ovpn_version_patch);
 

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1662?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: newchange
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ia7ad24181bd97dccbb77865c10e829778f72a506
Gerrit-Change-Number: 1662
Gerrit-PatchSet: 1
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>

#2 lore raw
In reply to a message not in the archive

Attention is currently required from: flichtenheld, plaisthos.

cron2 has posted comments on this change by flichtenheld. ( http://gerrit.openvpn.net/c/openvpn/+/1662?usp=email )

Change subject: sample: Fix cppcheck error invalidPrintfArgType_sint
......................................................................

Patch Set 2: Code-Review+2

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1662?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: comment
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ia7ad24181bd97dccbb77865c10e829778f72a506
Gerrit-Change-Number: 1662
Gerrit-PatchSet: 2
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-Comment-Date: Thu, 07 May 2026 07:54:47 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes

#3 lore raw

PATCH v2 1/1 sample: Fix cppcheck error invalidPrintfArgType_sint

In reply to a message not in the archive

From: Frank Lichtenheld <[email protected]...>

Change-Id Ia7ad24181bd97dccbb77865c10e829778f72a506

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1662
---

This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master.

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1662
This mail reflects revision 2 of this Change.

Acked-by according to Gerrit (reflected above):
Gert Doering <[email protected]...>

sample/sample-plugins/log/log_v3.c +1 -1
index deae590..d2d44c7 100644
@@ -91,7 +91,7 @@
     }
 
     /* Print some version information about the OpenVPN process using this plug-in */
-    printf("log_v3: OpenVPN %s  (Major: %i, Minor: %i, Patch: %s)\n", args->ovpn_version,
+    printf("log_v3: OpenVPN %s  (Major: %u, Minor: %u, Patch: %s)\n", args->ovpn_version,
            args->ovpn_version_major, args->ovpn_version_minor, args->ovpn_version_patch);
 
     /*  Which callbacks to intercept.  */
sample/sample-plugins/simple/base64.c +1 -1
index ab6aed8..3b11543 100644
@@ -122,7 +122,7 @@
     ovpn_base64_decode = args->callbacks->plugin_base64_decode;
 
     /* Print some version information about the OpenVPN process using this plug-in */
-    ovpn_log(PLOG_NOTE, PLUGIN_NAME, "OpenVPN %s  (Major: %i, Minor: %i, Patch: %s)\n",
+    ovpn_log(PLOG_NOTE, PLUGIN_NAME, "OpenVPN %s  (Major: %u, Minor: %u, Patch: %s)\n",
              args->ovpn_version, args->ovpn_version_major, args->ovpn_version_minor,
              args->ovpn_version_patch);
 
#4 lore raw

[Openvpn-devel] [PATCH applied] Re: sample: Fix cppcheck error invalidPrintfArgType_sint

Good find... the variables printed are defined in "openvpn-plugin.h" as "unsigned int", so we should print them as such :-) - not that it would make any difference (and "unsigned int" really leaves room for many many openvpn versions). So treating as cleanup, not bugfix.

Your patch has been applied to the master branch.

commit 74d39dfba2aa8d94110467788dfb9160fc739fad

Author: Frank Lichtenheld
Date:   Thu May 7 09:54:56 2026 +0200
     sample: Fix cppcheck error invalidPrintfArgType_sint

     Signed-off-by: Frank Lichtenheld <[email protected]...>
     Acked-by: Gert Doering <[email protected]...>
     Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1662
     Message-Id: <[email protected]...>
     URL: https://www.mail-archive.com/[email protected]/msg36844.html
     Signed-off-by: Gert Doering <[email protected]...>

--
kind regards,

Gert Doering

#5 lore raw
In reply to a message not in the archive

cron2 has uploaded a new patch set (#3) to the change originally created by flichtenheld. ( http://gerrit.openvpn.net/c/openvpn/+/1662?usp=email )

The following approvals got outdated and were removed:
Code-Review+2 by cron2

Change subject: sample: Fix cppcheck error invalidPrintfArgType_sint
......................................................................

sample: Fix cppcheck error invalidPrintfArgType_sint

Change-Id Ia7ad24181bd97dccbb77865c10e829778f72a506

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1662
Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg36844.html

---
M sample/sample-plugins/log/log_v3.c
M sample/sample-plugins/simple/base64.c

2 files changed, 2 insertions(+), 2 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/62/1662/3

sample/sample-plugins/log/log_v3.c +1 -1
index deae590..d2d44c7 100644
@@ -91,7 +91,7 @@
     }
 
     /* Print some version information about the OpenVPN process using this plug-in */
-    printf("log_v3: OpenVPN %s  (Major: %i, Minor: %i, Patch: %s)\n", args->ovpn_version,
+    printf("log_v3: OpenVPN %s  (Major: %u, Minor: %u, Patch: %s)\n", args->ovpn_version,
            args->ovpn_version_major, args->ovpn_version_minor, args->ovpn_version_patch);
 
     /*  Which callbacks to intercept.  */
sample/sample-plugins/simple/base64.c +1 -1
index ab6aed8..3b11543 100644
@@ -122,7 +122,7 @@
     ovpn_base64_decode = args->callbacks->plugin_base64_decode;
 
     /* Print some version information about the OpenVPN process using this plug-in */
-    ovpn_log(PLOG_NOTE, PLUGIN_NAME, "OpenVPN %s  (Major: %i, Minor: %i, Patch: %s)\n",
+    ovpn_log(PLOG_NOTE, PLUGIN_NAME, "OpenVPN %s  (Major: %u, Minor: %u, Patch: %s)\n",
              args->ovpn_version, args->ovpn_version_major, args->ovpn_version_minor,
              args->ovpn_version_patch);
 

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1662?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: newpatchset
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ia7ad24181bd97dccbb77865c10e829778f72a506
Gerrit-Change-Number: 1662
Gerrit-PatchSet: 3
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>

#6 lore raw
In reply to a message not in the archive

cron2 has submitted this change. ( http://gerrit.openvpn.net/c/openvpn/+/1662?usp=email )

Change subject: sample: Fix cppcheck error invalidPrintfArgType_sint
......................................................................

sample: Fix cppcheck error invalidPrintfArgType_sint

Change-Id Ia7ad24181bd97dccbb77865c10e829778f72a506

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1662
Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg36844.html

---
M sample/sample-plugins/log/log_v3.c
M sample/sample-plugins/simple/base64.c

2 files changed, 2 insertions(+), 2 deletions(-)
sample/sample-plugins/log/log_v3.c +1 -1
index deae590..d2d44c7 100644
@@ -91,7 +91,7 @@
     }
 
     /* Print some version information about the OpenVPN process using this plug-in */
-    printf("log_v3: OpenVPN %s  (Major: %i, Minor: %i, Patch: %s)\n", args->ovpn_version,
+    printf("log_v3: OpenVPN %s  (Major: %u, Minor: %u, Patch: %s)\n", args->ovpn_version,
            args->ovpn_version_major, args->ovpn_version_minor, args->ovpn_version_patch);
 
     /*  Which callbacks to intercept.  */
sample/sample-plugins/simple/base64.c +1 -1
index ab6aed8..3b11543 100644
@@ -122,7 +122,7 @@
     ovpn_base64_decode = args->callbacks->plugin_base64_decode;
 
     /* Print some version information about the OpenVPN process using this plug-in */
-    ovpn_log(PLOG_NOTE, PLUGIN_NAME, "OpenVPN %s  (Major: %i, Minor: %i, Patch: %s)\n",
+    ovpn_log(PLOG_NOTE, PLUGIN_NAME, "OpenVPN %s  (Major: %u, Minor: %u, Patch: %s)\n",
              args->ovpn_version, args->ovpn_version_major, args->ovpn_version_minor,
              args->ovpn_version_patch);
 

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1662?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: merged
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ia7ad24181bd97dccbb77865c10e829778f72a506
Gerrit-Change-Number: 1662
Gerrit-PatchSet: 3
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>